#ifndef __I386_KERNEL_TIMER_H__
#define __I386_KERNEL_TIMER_H__

#include "common/basictypes.h"
#include "common/linkage.h"

struct timer_opts {
  char* name;
  void (*mark_offset)(void);
  u32 (*get_offset)(void);
  u64 (*monotonic_clock)(void);
  void (*delay)(u32);
};

struct init_timer_opts {
  int (*init)(char* override);
  struct timer_opts *opts;
};

#define TICK_SIZE   (tick_nsec / 1000)

/*
 * 选取合适的 timer
 */
extern struct timer_opts* __init select_timer(void);

void __init time_init(void);

extern struct timer_opts timer_none;
extern struct timer_opts timer_pit;
extern struct timer_opts timer_tsc;

extern struct init_timer_opts timer_pit_init;
extern struct init_timer_opts timer_pit_tsc;


#endif  // __I386_KERNEL_TIMER_H__
